<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'share-form',
	'enableAjaxValidation'=>false,
	'htmlOptions' => array('enctype' => 'multipart/form-data' )
)); 

?>

	<div class="line">
		<?php echo $form->labelEx($model,'name'); ?>
		<?php echo $form->textField($model,'name',array('class'=>"medium")); ?>
		<?php echo $form->error($model,'name'); ?>
	</div>
	
	<div class="line">
		<?php echo $form->labelEx($model,'Header'); ?>
		<?php echo $form->textField($model,'Header',array('class'=>'medium')); ?>
		<?php echo $form->error($model,'Header'); ?>
	</div>

	<div class="line">
		<?php echo $form->labelEx($model,'isTop'); ?>
		<?php echo $form->checkBox($model,'isTop'); ?>
		
		<?php echo $form->error($model,'isTop'); ?>
	</div>

	<div class="line-multi" id="subcategory">
		<div><?php echo CHtml::label(Yii::t('app','Категории'),''); ?></div>		
		
		<? $categories = CHtml::listData(ShareCategory::model()->findAll(),'id', 'title'); ?>
		<?php echo CHtml::activeDropDownList($model, 'category', $categories, array(
			'multiple' => 'multiple',
			'style'=>'display:inline;'
			)); ?>		
		<div style="clear:both"></div>
	</div>   
	
	
	
	<div class="line">	
		<?
			$this->widget('pictures.components.PicturesEditor',
				      array('mode' =>'AddAjax',
				          'files' => $model->isNewRecord ? false : $model->getFiles()
			));
		?>
	</div>
	
	
	
	<div class="line">
		<?php echo $form->labelEx($model,'description'); ?>
		<?php echo $form->textArea($model,'description',array('class'=>'wysiwyg')); ?>
		<?php echo $form->error($model,'description'); ?>
	</div>
	
	<div class="line">
		<?php echo $form->labelEx($model,'short_info'); ?>
		<?php echo $form->textArea($model,'short_info',array('class'=>'wysiwyg')); ?>
		<?php echo $form->error($model,'short_info'); ?>
	</div>
	
		<div class="line">
		<?php echo $form->labelEx($model,'Content'); ?>
		<?php echo $form->textArea($model,'Content',array('class'=>'wysiwyg')); ?>
		<?php echo $form->error($model,'Content'); ?>
	</div>
	
	<div class="line">
		<?php echo $form->labelEx($model,'published'); ?>	
		<?php echo $form->checkBox($model,'published', array('id'=>'check-1', 'name'=>'checkbox')); ?>
		<label for="check-1"></label>
		<?php echo $form->error($model,'published'); ?>
	</div>
	
	<div class="line">
		<?php echo $form->labelEx($model,'Stopped'); ?>
		<?php echo $form->checkBox($model,'Stopped', array('id'=>'check-2', 'name'=>'checkbox')); ?>
		<label for="check-2"></label>
		<?php echo $form->error($model,'Stopped'); ?>
	</div>
	
	
	<div class="line">
		<?php echo $form->labelEx($model,'last_time'); ?>
		<?php echo $form->textField($model,'last_time',  array('class'=>'datepicker','value'=>$this->formateDate($model->last_time))); ?>
		<?php echo $form->error($model,'last_time'); ?>
	</div>
	
	<div class="line">
		<?php echo $form->labelEx($model,'last_time_can_buy'); ?>
		<?php echo $form->textField($model,'last_time_can_buy', array('class'=>'datepicker','value'=>$this->formateDate($model->last_time_can_buy))); ?>
		<?php echo $form->error($model,'last_time_can_buy'); ?>
	</div>
	
	<div class="line">
		<?php echo $form->labelEx($model,'begin_time_cuppons'); ?>
		<?php echo $form->textField($model,'begin_time_cuppons', array('class'=>'datepicker','value'=>$this->formateDate($model->begin_time_cuppons))); ?>
		<?php echo $form->error($model,'begin_time_cuppons'); ?>
	</div>
	
	<div class="line">
		<?php echo $form->labelEx($model,'last_time_cuppons'); ?>
		<?php echo $form->textField($model,'last_time_cuppons', array('class'=>'datepicker','value'=>$this->formateDate($model->last_time_cuppons))); ?>
		<?php echo $form->error($model,'last_time_cuppons'); ?>
	</div>
	
	
	<div class="line">
		<?php echo $form->labelEx($model,'cuppon_count'); ?>
		<?php echo $form->textField($model,'cuppon_count', array('class'=>'medium')); ?>
		<?php echo $form->error($model,'cuppon_count'); ?>
	</div>
	
	<div class="line">
		<?php echo $form->labelEx($model,'cuppon_limit'); ?>
		<?php echo $form->textField($model,'cuppon_limit', array('class'=>'medium')); ?>
		<?php echo $form->error($model,'cuppon_limit'); ?>
	</div>
	
	
	<div class="line">
		<?php echo $form->labelEx($model,'cuppon_limit_hand'); ?>
		<?php echo $form->textField($model,'cuppon_limit_hand', array('class'=>'medium')); ?>
		<?php echo $form->error($model,'cuppon_limit_hand'); ?>
	</div>
	
	
	<div class="line">
		<?php echo $form->labelEx($model,'price'); ?>
		<?php echo $form->textField($model,'price', array('class'=>'medium')); ?>
		<?php echo $form->error($model,'price'); ?>
	</div>
	
	<div class="line">
		<?php echo $form->labelEx($model,'price_out'); ?>
		<?php echo $form->textField($model,'price_out', array('class'=>'medium')); ?>
		<?php echo $form->error($model,'price_out'); ?>
	</div>
	
	<div class="line">
		<?php echo $form->labelEx($model,'skidka'); ?>
		<?php echo $form->textField($model,'skidka', array('class'=>'medium')); ?>
		<?php echo $form->error($model,'skidka'); ?>
	</div>
	
	
	<div class="line">
		<?php echo $form->labelEx($model,'cuppon_price'); ?>
		<?php echo $form->textField($model,'cuppon_price', array('class'=>'medium')); ?>
		<?php echo $form->error($model,'cuppon_price'); ?>
	</div>
	
	
	<div class="line" style="display:none;">
		<?php //echo $form->labelEx($model,'CityId'); ?>
		<? $cities = CHtml::listData(City::model()->findAll('city_id=3526'),'city_id', 'name'); ?>
		<?php echo CHtml::activeDropDownList($model, 'CityId', $cities, array(
				//'style'=>'display:none;'
			)); ?>		
		
		<?php echo $form->error($model,'CityId'); ?>
	</div>
	
	
	<div class="line">
		<?php echo $form->labelEx($model,'place'); ?>
		<?php echo $form->textField($model,'place',array('class'=>'medium')); ?>
		<?php echo $form->error($model,'place'); ?>
	</div>
	
	<div class="line">
		<?php echo $form->labelEx($model,'adress'); ?>
		<?php echo $form->textField($model,'adress',array('class'=>'medium')); ?>
		<?php echo $form->error($model,'adress'); ?>
	</div>
	
		<div class="line">
		<?php echo $form->labelEx($model,'place_info'); ?>
		<?php echo $form->textArea($model,'place_info',array('class'=>'wysiwyg')); ?>
		<?php echo $form->error($model,'place_info'); ?>
	</div>
	
	<div class="line">
		<?php echo $form->labelEx($model,'www'); ?>
		<?php echo $form->textField($model,'www',array('class'=>"medium")); ?>
		<?php echo $form->error($model,'www'); ?>
	</div>
	
	<div class="line">
		<?php echo $form->labelEx($model,'email'); ?>
		<?php echo $form->textField($model,'email',array('class'=>"medium")); ?>
		<?php echo $form->error($model,'email'); ?>
	</div>
	
	<div class="line">
		<?php echo $form->labelEx($model,'phone'); ?>
		<?php echo $form->textField($model,'phone',array('class'=>"medium")); ?>
		<?php echo $form->error($model,'phone'); ?>
	</div>
	
	<div class="line">
		<?php echo $form->labelEx($model,'skype'); ?>
		<?php echo $form->textField($model,'skype',array('class'=>"medium")); ?>
		<?php echo $form->error($model,'skype'); ?>
	</div>
	
	
	<div class="line">
		<?php echo $form->labelEx($model,'google_map'); ?>
		<?php echo $form->textArea($model,'google_map',array('class'=>'medium')); ?>
		<?php echo $form->error($model,'google_map'); ?>
	</div>

	<div class="line">
		<?php echo $form->labelEx($model,'video_link'); ?>
		<?php echo $form->textField($model,'video_link',array('class'=>'medium')); ?>
		<?php echo $form->error($model,'video_link'); ?>
	</div>
	
	
	<div class="line">
		<?php echo $form->labelEx($model,'partners'); ?>
		<?php echo $form->dropDownList($model,'partners', CHtml::listData(Company::model()->findAll(), 'id', 'title')); ?>
		<?php echo $form->error($model,'partners'); ?>
	</div>
	

	<div class="line">
		<?php echo $form->labelEx($model,'sort'); ?>
		<?php echo $form->textField($model,'sort', array('class'=>'small')); ?>
		<?php echo $form->error($model,'sort'); ?>
	</div>
	
	
	<div class="line">
		<?php echo $form->labelEx($model,'owner_id'); ?>
		<?php echo $form->dropDownList($model,'owner_id', CHtml::listData(User::model()->findAll(), 'id', 'username')); ?>
		<?php echo $form->error($model,'owner_id'); ?>
	</div>
	
	
	
	

	<div class="line">
		<?php echo $form->labelEx($model,'kuponator'); ?>
		<?php echo $form->textArea($model,'kuponator',array('class'=>'medium')); ?>
		<?php echo $form->error($model,'kuponator'); ?>
	</div>
	
	<div class="line">
		<?php echo $form->labelEx($model,'bought_cuppon_count'); ?>
		<?php echo $form->textField($model,'bought_cuppon_count'); ?>
		<?php echo $form->error($model,'bought_cuppon_count'); ?>
	</div>
	


	<div class="line">
            
           <?php
       if     (!$model->isNewRecord)
       {
			$this->widget('ext.imgajaxload.loadimgWidget',
				      array('actionname' =>'/admin/cuppons/admin/cupponsimg2?id='.$model->id,
                                          'mode'=>'images2',
                                          'urlpath'=>'/images/cuppons/'
			));
       } else
       {
           $this->widget('ext.imgajaxload.loadimgWidget',
				      array('actionname' =>'/admin/cuppons/admin/cupponsimg',
                                          'mode'=>'images2',
                                          'urlpath'=>'/images/cuppons/'
			));
       }
		?>
            
           
	</div>

	


	<div class="line">
            
           <?php
       if     (!$model->isNewRecord)
       {
			$this->widget('ext.imgajaxload.loadimgWidget',
				      array('actionname' =>'/admin/cuppons/admin/cupponsvid2?id='.$model->id,
                                          'mode'=>'videolist',
                                          'urlpath'=>'/images/cuppons/'
			));
       } else
       {
           $this->widget('ext.imgajaxload.loadimgWidget',
				      array('actionname' =>'/admin/cuppons/admin/cupponsvid',
                                          'mode'=>'videolist',
                                          'urlpath'=>'/images/cuppons/'
			));
       }
		?>
            
           
	</div>
	
	
	
	
	
	
	
	
<p class="note">Поля помеченные <span class="required">*</span> обязательны для заполнения.</p>


	<div class="line button">		
		<button type="submit" class="green big"><span><?= $model->isNewRecord ? Yii::t('app', 'Добавить') : Yii::t('app', 'Сохранить'); ?></span></button>
		<button type="button" onclick="window.location.href=' <?=$this->createUrl('admin'); ?>'" class="green big"><span><?= Yii::t('app', 'Отмена'); ?></span></button>
	</div>

<?php $this->endWidget(); ?>
